const { mysql } = require('../qcloud')

module.exports = async (ctx) => {
	const { id,note } = ctx.request.body

	try {
		await mysql('records')
			.where('id',id)
			.update('note',note)
		//执行成功返回到前端的数据
		ctx.state.data = {
			code: 0,
			msg: 'success'
		}
		console.log("执行成功")
	} catch(err) {
		//执行失败返回到前端的数据
		ctx.state = {
			code: -1,
			data: {
				msg: '撤销失败' + err.sqlMessage
			}
		}
		console.log("执行失败")
	}
}